﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Furion.CMS.Web.Core
{
    public class SpaStaticSetting
    {
        /// <summary>
        /// 构建结果根目录
        /// </summary>
        public string RootPath { get; set; }
        /// <summary>
        /// Umi源路径
        /// </summary>
        public string SourcePath { get; set; }
        /// <summary>
        /// 有效请求称谓
        /// </summary>
        public string[] VaildMethods { get; set; }
        /// <summary>
        /// 忽略的地址请求前缀
        /// </summary>
        public string[] IgnoreUrlPrefixs { get; set; }


        public bool HasIgnoreUrlPrefix(string path)
        {
            if (IgnoreUrlPrefixs?.Any() ?? false)
            {
               return IgnoreUrlPrefixs.Where(t => path.StartsWith(t)).Any();
            }
            return false;
        }

    }
}
